/**
* file name  : GetFile.java
* authors    : Luciano Xumerle
* created    : ven 12 ago 2005 15:20:27 CEST
*
* Copyright (c) 2004-2005 Luciano Xumerle. All rights reserved.
*
* This file is part of gephinfo.
*
* gephinfo is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*
*/

package it.ciano.jenoware;

/**
 * The class GetFile provides an interface to export data contained Pedigree
 * into a Pedigree object to file.
 *
 * @author Luciano Xumerle
 * @version 0.0.1
 */
abstract class GetFile {
    // GLOBAL PRIVATE VARS
    private Pedigree ped;

    private String filename;

    /**
     * Class Constructor.
     *
     * @param pedigree a populated Pedigree object
     */
    public GetFile ( Pedigree pedigree ) {
        ped = pedigree;
        filename = "out";
    }

    /**
     * Returns the Pedigree object.
     *
     * @return the Pedigree object.
     */
    final public Pedigree getPed() {
        return ped;
    }

    /**
     * Returns the filename without extension (Default is "out").
     *
     * @return the filename without extension (Default is "out").
     */
    final public String getFilename() {
        return filename;
    }

    /**
     * Sets a new filename (without extension) for the output file.
     *
     * @param name the new filename (must have .inp extension)
     */
    final public void setFilename ( String name ) {
        filename = name;
    }

    /**
     * Overriding toString method
     *
     * @return all informations that will be contained into the destination files.
     */
    abstract public String toString();

    /**
     * Creates all the expected files.
     *
     * @return true if all operations are ok.
     */
    abstract public boolean createsFile();

} // end class

